﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using WalkingTec.Mvvm.Core;

namespace K9Nano.IM.Models
{
    public class ChatGroup: BasePoco
    {
        [Display(Name = "名称")]
        [Required(AllowEmptyStrings = false)]
        [StringLength(50, ErrorMessage = "{0}stringmax{1}")]
        public string Name { get; set; }

        [Display(Name = "所有者")]
        [Required]
        public Guid OwnerId { get; set; }

        [Display(Name = "所有者")]
        public virtual User Owner { get; set; }

        [Display(Name = "成员")]
        public virtual List<ChatGroupMember> Members { get; set; }

        [Display(Name = "头像")]
        [StringLength(200, ErrorMessage = "{0}stringmax{1}")]
        public string Avatar { get; set; }

        [Display(Name = "默认")]
        [Required]
        public bool Default { get; set; }

        [Display(Name = "APP")]
        public Guid? AppId { get; set; }

        public virtual ChatApp App { get; set; }
    }
}